<ui:composition template="/admin/templates/ui2.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:composite="http://java.sun.com/jsf/composite/primefaces"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	<f:metadata>
		<f:viewParam name="id" value="#{menuTypeHome.id}"></f:viewParam>
	</f:metadata>


	<ui:define name="content">
		<div class="entry">
			<p:toolbar styleClass="admin-nav-toolbar">
				<p:toolbarGroup>
					<h:outputLabel
						value="#{commonMsg.currentPositionLabel} #{commonMsg.editLabel}#{menuMsg.menuTypeLabel}"></h:outputLabel>
				</p:toolbarGroup>
				<p:toolbarGroup align="right">
					<p:separator />
					<p:button value="#{menuMsg.menuTypeManageLabel}"
						outcome="/admin/menu/menuTypeList"></p:button>
				</p:toolbarGroup>
			</p:toolbar>
			<p:spacer></p:spacer>

			<h:form id="form">
				<h:panelGrid id="panel" columns="2" columnClasses="col1,col2">
					<h:outputLabel value="#{commonMsg.IDLabel}"></h:outputLabel>
					<h:inputText value="#{menuTypeHome.instance.id}"
						readonly="#{not empty menuTypeHome.instance.id}" required="true"
						requiredMessage="#{commonMsg.IdRequired}"></h:inputText>

					<h:outputLabel value="#{menuMsg.menuTypeLabel}"></h:outputLabel>
					<h:inputText id="name" required="true"
						label="#{menuMsg.menuTypeLabel}"
						value="#{menuTypeHome.instance.name}">
						<f:validateLength minimum="2"></f:validateLength>
					</h:inputText>

					<h:outputLabel value="#{commonMsg.enableLabel}"></h:outputLabel>
					<h:selectOneMenu value="#{menuTypeHome.instance.enable}">
						<f:selectItem itemValue="1"
							itemLabel="#{commonMsg.enableSelectLabel}" />
						<f:selectItem itemValue="0"
							itemLabel="#{commonMsg.disableSelectLabel}" />
					</h:selectOneMenu>

					<h:outputLabel value="#{commonMsg.descriptionLabel}"></h:outputLabel>
					<h:inputTextarea value="#{menuTypeHome.instance.description}"
						style="width:600px;height:60px;"></h:inputTextarea>

					<h:outputLabel value="#{commonMsg.actionLabel}"></h:outputLabel>
					<ui:fragment>
						<p:commandButton id="saveBtn" action="#{menuTypeHome.save}"
							update="@form" value="#{commonMsg.saveLabel}"></p:commandButton>
						<p:commandButton type="reset" value="#{commonMsg.resetLabel}"></p:commandButton>
						<p:blockUI block="panel" trigger="saveBtn" />
					</ui:fragment>

				</h:panelGrid>

			</h:form>
		</div>
	</ui:define>
</ui:composition>

<ui:composition template="/admin/templates/ui.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:composite="http://java.sun.com/jsf/composite/primefaces"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	<f:metadata>
		<f:viewParam name="id" value="#{menuTypeHome.id}"></f:viewParam>
	</f:metadata>


	<ui:define name="content">
		<div class="entry">
			<p:toolbar styleClass="admin-nav-toolbar">
				<p:toolbarGroup>
					<h:outputLabel
						value="当前位置：菜单分类编辑"></h:outputLabel>
				</p:toolbarGroup>
				<p:toolbarGroup align="right">
					<p:separator />
<!-- 					<p:button value="菜单分类" -->
<!-- 						outcome="/admin/menu/menuTypeList"></p:button> -->
				</p:toolbarGroup>
			</p:toolbar>
			<p:spacer></p:spacer>

			<h:form id="form">
				<h:panelGrid id="panel" columns="2" columnClasses="col1,col2">
					<h:outputLabel value="编号"></h:outputLabel>
					<h:inputText value="#{menuTypeHome.instance.id}"
						readonly="#{not empty menuTypeHome.instance.id}" required="true"
						requiredMessage="#{commonMsg.IdRequired}"></h:inputText>

					<h:outputLabel value="菜单类型"></h:outputLabel>
					<h:inputText id="name" required="true"
						label="#{menuMsg.menuTypeLabel}"
						value="#{menuTypeHome.instance.name}">
						<f:validateLength minimum="2"></f:validateLength>
					</h:inputText>

					<h:outputLabel value="是否可用"></h:outputLabel>
					<h:selectOneMenu value="#{menuTypeHome.instance.enable}">
						<f:selectItem itemValue="1"
							itemLabel="可用" />
						<f:selectItem itemValue="0"
							itemLabel="不可用" />
					</h:selectOneMenu>

					<h:outputLabel value="描述"></h:outputLabel>
					<h:inputTextarea value="#{menuTypeHome.instance.description}"
						style="width:600px;height:60px;"></h:inputTextarea>

					<h:outputLabel value="操作"></h:outputLabel>
					<ui:fragment>
						<p:commandButton id="saveBtn" action="#{menuTypeHome.save()}"
							update="@form" value="保存"></p:commandButton>
						<p:commandButton type="reset" value="重置"></p:commandButton>
						<p:blockUI block="panel" trigger="saveBtn" />
					</ui:fragment>

				</h:panelGrid>

			</h:form>
		</div>
	</ui:define>
</ui:composition>

